/******************************************************
 *  Project： 
 *  Function:
 *  Description: ${description}
 *  PROJECT_FILENAME: ${PROJECT_FILENAME}
 *  Author: coder-itl
 ******************************************************
 *  Copyright $NOW_L by coder-itl
 ******************************************************/


#include <stdio.h>

#include "Element.h"
#include "SeqQueue.h"

void YangHuiTriangle(int N);

/* ElementType 类型不为 int */
ElementType datas[] = {
        {1, "1001"},
        {2, "1002"},
        {3, "1003"}
};

void seqQueueTest();

int main() {
    /* 测试队列操作是否正常 */
    seqQueueTest();

    return 0;
}

void seqQueueTest() {
    SeqQueue seqQueue;
    InitSeqQue(&seqQueue);
    *//* 入队 *//*
    for (int i = 0; i < sizeof(datas) / sizeof(datas[0]); i++) {
        EnterSeqQueue(&seqQueue, datas[i]);
    }
    *//* 输出 *//*
    for (int i = 0; i < sizeof(datas) / sizeof(datas[0]); i++) {
        printf("%d\t%s\n", seqQueue.data[i].id, seqQueue.data[i].name);
    }

    /* 测试出队 */
    ElementType *element = (ElementType *) malloc(sizeof(ElementType));
    OutSeqQueue(&seqQueue, element);
    printf("当前出队的元素: \n");
    printf("%d\t%s\n", element->id, element->name);
    printf("出队操作后的队列元素: \n");
    for (int i = seqQueue.front; i < seqQueue.rear; i++) {
        printf("%d\t%s\n", seqQueue.data[i].id, seqQueue.data[i].name);
    }

}
